// APP
if (window.plus) {
    scanResultPageReady();
} else {
    document.addEventListener('plusready', scanResultPageReady, false);
}
// Web
$(function() {
    if (AGENT_CLIENT.WEB) {
        scanResultPageReady();
    }
});

function scanResultPageReady() {
    var scanResultPage = function() {
        this.init();
    };
    scanResultPage.prototype = {
        // 初始化
        init: function() {
            this.loadPage();
            this.bindEvent();
        },
        loadPage: function() {
            var result = getPageParams(PAGE_NAME.barcode_scanresult);
            var urlExpression = new RegExp('(http|https)://');
            if (urlExpression.test(result)) {
                $("#resultiframe").attr("src", result).show();
            } else {
            		result = "商品不存在";
                $("#resultmessage").html("<b>" + result + "</b>").show();
            }
        },
        // 绑定事件
        bindEvent: function() {
            //var model = this;
            //// 返回
            //$("#btnback").on("click", function () {
            //    back();
            //});
        },
    };
    var _scanResultPage = new scanResultPage();
}
// 设置标题
function setTitle(title) {
    $("#pagetitle").text(title);
}